package com.wiz.weixin.criteria;

public abstract class CriteriaTO {
	/**
	 * 每页显示几条记录
	 */
	private int pageSize= 10;
	/**
	 *默认 当前页 为第一页
	 *这个数是计算出来的
	 */
	private int pageNo= 1;
	/**
	 * 是否分页
	 */
	private Boolean isNeedPaging;
	/**
	 * 开始索引
	 */
	private int startIndex;
	/**
	 * 结束索引
	 */
	private int endIndex;
	
	
	public CriteriaTO() {
		super();
	}

	public CriteriaTO(int pageSize, int pageNo, Boolean isNeedPaging,
			int startIndex, int endIndex) {
		this.pageSize = pageSize;
		this.pageNo = pageNo;
		this.isNeedPaging = isNeedPaging;
		this.startIndex = startIndex;
		this.endIndex = endIndex;
	}

	public Boolean getIsNeedPaging() {
		return isNeedPaging;
	}

	public void setIsNeedPaging(Boolean isNeedPaging) {
		this.isNeedPaging = isNeedPaging;
	}

	public int getStartIndex() {
		if (this.startIndex == 0)
			return (this.pageNo - 1) * this.pageSize;
		else
			return this.startIndex;

	}

	public void setStartIndex(int startIndex) {
		this.startIndex = startIndex;
	}

	public int getEndIndex() {
		return this.pageNo * this.pageSize;
	}

	public void setEndIndex(int endIndex) {
		this.endIndex = endIndex;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getPageNo() {
		return pageNo;
	}

	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}



}
